package cn.edu.neusoft.model.mapper;

import cn.edu.neusoft.model.bean.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserMapper {
    // 插入操作
    @Insert("INSERT INTO users (id, code, name, sex, person_type, is_admin, paper_type, paper_type_name, paper_number, paper_address, " +
            "country, nation, nation_name, phone, email, email_ext, department_id, valid_start_time, valid_end_time, status, password, " +
            "owner_code, person_identity_id, record_update_time, update_time, self_code, birthday, age) " +
            "VALUES (#{id}, #{code}, #{name}, #{sex}, #{personType}, #{isAdmin}, #{paperType}, #{paperTypeName}, #{paperNumber}, #{paperAddress}, " +
            "#{country}, #{nation}, #{nationName}, #{phone}, #{email}, #{emailExt}, #{departmentId}, #{validStartTime}, #{validEndTime}, #{status}, #{password}, " +
            "#{ownerCode}, #{personIdentityId}, #{recordUpdateTime}, #{updateTime}, #{selfCode}, #{birthday}, #{age})")
    void insertUser( User user);

    // 清空表操作
    @Delete("TRUNCATE TABLE users")
    void truncateTable();
}
